gtk/gtkstyle.c (gtk_style_class_init): Add some missed
Since: 2.4.
-Thu Feb 26 15:43:19 2004 Owen Taylor <otaylor@redhat.com>
-
* gtk/gtkiconfactory.c (icon_size_settings_changed)
gtk/gtkicontheme.c (do_theme_change)
gtk/gtkrc.c (_gtk_rc_context_get_default_font_name)
* gtk/gtk.def: Export gtk_rc_reset_styles()
->>>>>>> 1.5027
Thu Feb 26 14:47:22 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Export gtk_rc_reset_styles().
gtk/gtkstyle.c (gtk_style_class_init): Add some missed
Since: 2.4.
-Thu Feb 26 15:43:19 2004 Owen Taylor <otaylor@redhat.com>
-
* gtk/gtkiconfactory.c (icon_size_settings_changed)
gtk/gtkicontheme.c (do_theme_change)
gtk/gtkrc.c (_gtk_rc_context_get_default_font_name)
* gtk/gtk.def: Export gtk_rc_reset_styles()
->>>>>>> 1.5027
Thu Feb 26 14:47:22 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Export gtk_rc_reset_styles().
gtk/gtkstyle.c (gtk_style_class_init): Add some missed
Since: 2.4.
-Thu Feb 26 15:43:19 2004 Owen Taylor <otaylor@redhat.com>
-
* gtk/gtkiconfactory.c (icon_size_settings_changed)
gtk/gtkicontheme.c (do_theme_change)
gtk/gtkrc.c (_gtk_rc_context_get_default_font_name)
* gtk/gtk.def: Export gtk_rc_reset_styles()
->>>>>>> 1.5027
Thu Feb 26 14:47:22 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Export gtk_rc_reset_styles().
gtk/gtkstyle.c (gtk_style_class_init): Add some missed
Since: 2.4.
-Thu Feb 26 15:43:19 2004 Owen Taylor <otaylor@redhat.com>
-
* gtk/gtkiconfactory.c (icon_size_settings_changed)
gtk/gtkicontheme.c (do_theme_change)
gtk/gtkrc.c (_gtk_rc_context_get_default_font_name)
* gtk/gtk.def: Export gtk_rc_reset_styles()
->>>>>>> 1.5027
Thu Feb 26 14:47:22 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Export gtk_rc_reset_styles().
gtk/gtkstyle.c (gtk_style_class_init): Add some missed
Since: 2.4.
-Thu Feb 26 15:43:19 2004 Owen Taylor <otaylor@redhat.com>
-
* gtk/gtkiconfactory.c (icon_size_settings_changed)
gtk/gtkicontheme.c (do_theme_change)
gtk/gtkrc.c (_gtk_rc_context_get_default_font_name)
* gtk/gtk.def: Export gtk_rc_reset_styles()
->>>>>>> 1.5027
Thu Feb 26 14:47:22 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Export gtk_rc_reset_styles().
gtk_paint_expander
gtk_paint_layout
gtk_paint_resize_grip
+gtk_draw_insertion_cursor
<SUBSECTION>
GtkBorder
GtkTextDirection dir2 = GTK_TEXT_DIR_NONE;
gint x1 = 0;
gint x2 = 0;
- GdkGC *gc;
gdk_drawable_get_size (entry->text_area, NULL, &text_area_height);
cursor_location.width = 0;
cursor_location.height = text_area_height - 2 * INNER_BORDER ;
- gc = _gtk_get_insertion_cursor_gc (widget, TRUE);
- _gtk_draw_insertion_cursor (widget, entry->text_area, gc,
- &cursor_location, dir1,
- dir2 != GTK_TEXT_DIR_NONE);
- g_object_unref (gc);
+ gtk_draw_insertion_cursor (widget, entry->text_area, NULL,
+ &cursor_location, TRUE, dir1,
+ dir2 != GTK_TEXT_DIR_NONE);
if (dir2 != GTK_TEXT_DIR_NONE)
{
cursor_location.x = xoffset + x2;
- gc = _gtk_get_insertion_cursor_gc (widget, FALSE);
- _gtk_draw_insertion_cursor (widget, entry->text_area, gc,
- &cursor_location, dir2,
- TRUE);
- g_object_unref (gc);
+ gtk_draw_insertion_cursor (widget, entry->text_area, NULL,
+ &cursor_location, FALSE, dir2,
+ TRUE);
}
}
}
{
icon_size_set_all_from_settings (settings);
- _gtk_rc_reset_styles (settings);
+ gtk_rc_reset_styles (settings);
}
static void
if (priv->screen && priv->is_screen_singleton)
{
GtkSettings *settings = gtk_settings_get_for_screen (priv->screen);
- _gtk_rc_reset_styles (settings);
+ gtk_rc_reset_styles (settings);
}
}
GdkRectangle cursor_location;
GtkTextDirection dir1 = GTK_TEXT_DIR_NONE;
GtkTextDirection dir2 = GTK_TEXT_DIR_NONE;
- GdkGC *gc;
keymap_direction =
(gdk_keymap_get_direction (gdk_keymap_get_for_display (gtk_widget_get_display (widget))) == PANGO_DIRECTION_LTR) ?
cursor_location.width = 0;
cursor_location.height = PANGO_PIXELS (cursor1->height);
- gc = _gtk_get_insertion_cursor_gc (widget, TRUE);
- _gtk_draw_insertion_cursor (widget, widget->window, gc,
- &cursor_location, dir1,
- dir2 != GTK_TEXT_DIR_NONE);
- g_object_unref (gc);
+ gtk_draw_insertion_cursor (widget, widget->window, NULL,
+ &cursor_location, TRUE, dir1,
+ dir2 != GTK_TEXT_DIR_NONE);
if (dir2 != GTK_TEXT_DIR_NONE)
{
cursor_location.width = 0;
cursor_location.height = PANGO_PIXELS (cursor2->height);
- gc = _gtk_get_insertion_cursor_gc (widget, FALSE);
- _gtk_draw_insertion_cursor (widget, widget->window, gc,
- &cursor_location, dir2, TRUE);
- g_object_unref (gc);
+ gtk_draw_insertion_cursor (widget, widget->window, NULL,
+ &cursor_location, FALSE, dir2,
+ TRUE);
}
}
}
* vice-versa, and when a buttton is moved from one group of 2 or
* more buttons to a different one, but not when the composition
* of the group that a button belongs to changes.
+ *
+ * Since: 2.4
*/
group_changed_signal = g_signal_new ("group-changed",
G_OBJECT_CLASS_TYPE (object_class),
* to changes. This is emitted when a radio menu item switches from
* being alone to being part of a group of 2 or more menu items, or
* vice-versa, and when a buttton is moved from one group of 2 or
- * more menu items to a different one, but not when the composition
+ * more menu items ton a different one, but not when the composition
* of the group that a menu item belongs to changes.
+ *
+ * Since: 2.4
*/
group_changed_signal = g_signal_new ("group-changed",
G_OBJECT_CLASS_TYPE (object_class),
g_free (context->font_name);
context->font_name = g_strdup (new_font_name);
- _gtk_rc_reset_styles (settings);
+ gtk_rc_reset_styles (settings);
}
g_free (new_font_name);
case PROP_XFT_DPI:
pango_xft_substitute_changed (GDK_SCREEN_XDISPLAY (settings->screen),
GDK_SCREEN_XNUMBER (settings->screen));
- /* See comments with _gtk_rc_reset_styles for why this is a hack
+ /* This is a hack because with gtk_rc_reset_styles() doesn't get
+ * widgets with gtk_widget_style_set(), and also causes more
+ * recomputation than necessary.
*/
- _gtk_rc_reset_styles (GTK_SETTINGS (object));
+ gtk_rc_reset_styles (GTK_SETTINGS (object));
break;
#endif /* GDK_WINDOWING_X11 */
}
* colormap and depth. Connecting to this signal is probably seldom
* useful since most of the time applications and widgets only
* deal with styles that have been already realized.
+ *
+ * Since: 2.4
*/
realize_signal = g_signal_new ("realize",
G_TYPE_FROM_CLASS (object_class),
* and depth are being cleaned up. A connection to this signal can be useful
* if a widget wants to cache objects like a #GdkGC as object data on #GtkStyle.
* This signal provides a convenient place to free such cached objects.
+ *
+ * Since: 2.4
*/
unrealize_signal = g_signal_new ("unrealize",
G_TYPE_FROM_CLASS (object_class),
return gtk_gc_get (widget->style->depth, widget->style->colormap, &gc_values, gc_values_mask);
}
-/**
- * _gtk_get_insertion_cursor_gc:
- * @widget: a #GtkWidget
- * @is_primary: if the cursor should be the primary cursor color.
- *
- * Get a GC suitable for drawing the primary or secondary text
- * cursor.
- *
- * Note: the return value is ref'ed because calls to this function
- * on other widgets could result in this the GC being released
- * which would be an unexpected side effect. If made public,
- * this function should possibly be called create_insertion_cursor_gc().
- *
- * Return value: an appropriate #GdkGC. Call g_object_unref() on
- * the gc when you are done with it; this GC may be shared with
- * other users, so you must not modify the GC except for temporarily
- * setting the clip before drawing with the GC, and then unsetting the clip
- * again afterwards.
- **/
-GdkGC *
-_gtk_get_insertion_cursor_gc (GtkWidget *widget,
- gboolean is_primary)
+static GdkGC *
+get_insertion_cursor_gc (GtkWidget *widget,
+ gboolean is_primary)
{
CursorInfo *cursor_info;
"cursor-color",
&widget->style->black);
- return g_object_ref (cursor_info->primary_gc);
+ return cursor_info->primary_gc;
}
else
{
"secondary-cursor-color",
&gray);
- return g_object_ref (cursor_info->secondary_gc);
+ return cursor_info->secondary_gc;
}
}
-/**
- * _gtk_draw_insertion_cursor:
- * @widget: a #GtkWidget
- * @drawable: a #GdkDrawable
- * @gc: a #GdkGC
- * @location: location where to draw the cursor (@location->width is ignored)
- * @direction: whether the cursor is left-to-right or
- * right-to-left. Should never be #GTK_TEXT_DIR_NONE
- * @draw_arrow: %TRUE to draw a directional arrow on the
- * cursor. Should be %FALSE unless the cursor is split.
- *
- * Draws a text caret on @drawable at @location. This is not a style function
- * but merely a convenience function for drawing the standard cursor shape.
- **/
-void
-_gtk_draw_insertion_cursor (GtkWidget *widget,
- GdkDrawable *drawable,
- GdkGC *gc,
- GdkRectangle *location,
- GtkTextDirection direction,
- gboolean draw_arrow)
+static void
+draw_insertion_cursor (GtkWidget *widget,
+ GdkDrawable *drawable,
+ GdkGC *gc,
+ GdkRectangle *location,
+ GtkTextDirection direction,
+ gboolean draw_arrow)
{
gint stem_width;
gint arrow_width;
}
}
}
+
+/**
+ * gtk_draw_insertion_cursor:
+ * @widget: a #GtkWidget
+ * @drawable: a #GdkDrawable
+ * @area: rectangle to which the output is clipped, or %NULL if the
+ * output should not be clipped
+ * @location: location where to draw the cursor (@location->width is ignored)
+ * @is_primary: if the cursor should be the primary cursor color.
+ * @direction: whether the cursor is left-to-right or
+ * right-to-left. Should never be #GTK_TEXT_DIR_NONE
+ * @draw_arrow: %TRUE to draw a directional arrow on the
+ * cursor. Should be %FALSE unless the cursor is split.
+ *
+ * Draws a text caret on @drawable at @location. This is not a style function
+ * but merely a convenience function for drawing the standard cursor shape.
+ *
+ * Since: 2.4
+ **/
+void
+gtk_draw_insertion_cursor (GtkWidget *widget,
+ GdkDrawable *drawable,
+ GdkRectangle *area,
+ GdkRectangle *location,
+ gboolean is_primary,
+ GtkTextDirection direction,
+ gboolean draw_arrow)
+{
+ GdkGC *gc;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (GDK_IS_DRAWABLE (drawable));
+ g_return_if_fail (location != NULL);
+ g_return_if_fail (direction != GTK_TEXT_DIR_NONE);
+
+ gc = get_insertion_cursor_gc (widget, is_primary);
+ if (area)
+ gdk_gc_set_clip_rectangle (gc, area);
+
+ draw_insertion_cursor (widget, drawable, gc,
+ location, direction, draw_arrow);
+
+ if (area)
+ gdk_gc_set_clip_rectangle (gc, NULL);
+}
const gchar *string);
#endif /* GTK_DISABLE_DEPRECATED */
-GdkGC *_gtk_get_insertion_cursor_gc (GtkWidget *widget,
- gboolean is_primary);
-void _gtk_draw_insertion_cursor (GtkWidget *widget,
- GdkDrawable *drawable,
- GdkGC *gc,
- GdkRectangle *location,
- GtkTextDirection direction,
- gboolean draw_arrow);
+void gtk_draw_insertion_cursor (GtkWidget *widget,
+ GdkDrawable *drawable,
+ GdkRectangle *area,
+ GdkRectangle *location,
+ gboolean is_primary,
+ GtkTextDirection direction,
+ gboolean draw_arrow);
#ifdef __cplusplus
}
GtkTextCursorDisplay *cursor = cursor_list->data;
GtkTextDirection dir;
GdkRectangle cursor_location;
- GdkGC *gc;
dir = line_display->direction;
if (have_strong && have_weak)
cursor_location.y = current_y + line_display->top_margin + cursor->y;
cursor_location.width = 0;
cursor_location.height = cursor->height;
-
- gc = _gtk_get_insertion_cursor_gc (widget, cursor->is_strong);
- gdk_gc_set_clip_rectangle(gc, &clip);
- _gtk_draw_insertion_cursor (widget, drawable, gc, &cursor_location,
- dir, have_strong && have_weak);
- gdk_gc_set_clip_rectangle (gc, NULL);
- g_object_unref (gc);
+ gtk_draw_insertion_cursor (widget, drawable, &clip, &cursor_location,
+ cursor->is_strong,
+ dir, have_strong && have_weak);
cursor_list = cursor_list->next;
}